---
title: OpenAI Providers
subtitle: Use Composio with OpenAI's Responses and Chat Completion APIs
slug: /providers/openai
image: "https://og.composio.dev/api/og?title=OpenAI%20Providers"   # image for socials
keywords: ""
hide-nav-links: false
---

The OpenAI Provider is the default provider for the Composio SDK. It transforms Composio tools into a format compatible with OpenAI's function calling capabilities through both the Responses and Chat Completion APIs.

## Setup
By default, the OpenAI Provider is installed when you install the Composio SDK. You can also install it manually:

<CodeGroup>
```bash title="Python" for="python"
pip install composio_openai
```
```bash title="TypeScript" for="typescript"
npm install @composio/openai
```
</CodeGroup>

## Responses API
The Responses API is the recommended way to build more agentic flows with the OpenAI API. 
Read more about it in the [OpenAI documentation](https://platform.openai.com/docs/api-reference/responses)

<Note>
Before executing any tools that require authentication (like Gmail), you'll need to:
1. [Create an Auth Configuration](/docs/authenticating-tools#creating-an-auth-config) for your integration
2. [Set up a Connected Account](/docs/authenticating-tools#connecting-an-account) for the user.
</Note>

<CodeGroup>
<SnippetCode 
  src="fern/snippets/providers/python/openai-responses-provider.py"
  startLine={1}
  endLine={39}
/>
<SnippetCode
  src="fern/snippets/providers/typescript/openairesponses.ts"
  startLine={1}
  endLine={38}
/>

</CodeGroup>

## Chat Completion API
The Chat Completion API generates a model response from a list of messages. Read more about it in the [OpenAI documentation](https://platform.openai.com/docs/api-reference/chat).
The OpenAI Chat Provider is the default provider used by Composio SDK, but you can also explicitly initialise it.

<Note>
Before executing any tools that require authentication (like Gmail), you'll need to:
1. [Create an Auth Configuration](/docs/authenticating-tools#creating-an-auth-config) for your integration
2. [Set up a Connected Account](/docs/authenticating-tools#connecting-an-account) for the user.

</Note>
<CodeGroup>
<SnippetCode
  src="fern/snippets/providers/python/openai-provider.py"
  startLine={1}
  endLine={25}
/>
<SnippetCode
  src="fern/snippets/providers/typescript/openai.ts"
  startLine={1}
  endLine={40}
/>

</CodeGroup>


## Modifiers
Modifiers are functions that can be used to intercept and optionally **modify** the schema, the tool call request and the response from the tool call.

OpenAI provider modifiers are the standard framework modifiers.
Read more here: [Modifying tool schemas](/docs/modifying-tool-schemas)

